import { axios } from '@/utils/request'

/**
 * 查询所有服务商
 */
export function selectAllCompany (type) {
  const parameter = {}
  if (type != undefined) {
    parameter.type = type
  }
  return axios({
    url: '/sys/company/selectAllCompany',
    method: 'post',
    params: parameter
  })
}

export function selectPage (parameter) {
  return axios({
    url: '/sys/company/selectPage',
    method: 'post',
    params: parameter
  })
}

export function saveOrUpdate (parameter) {
  return axios({
    url: '/sys/company/saveOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function del (id) {
  return axios({
    url: '/sys/company/' + id + '/delete',
    method: 'get'
  })
}

export function selectAgentTree () {
  return axios({
    url: '/sys/company/selectAgentTree',
    method: 'post'
  })
}

export function updateNotifyUrl (parameter) {
  return axios({
    url: '/sys/company/updateNotifyUrl',
    method: 'post',
    params: parameter
  })
}

export function getCallBack (id) {
  return axios({
    url: '/sys/company/' + id + '/getCallBack',
    method: 'get'
  })
}

export function setCallBack (parameter) {
  return axios({
    url: '/sys/company/setCallBack',
    method: 'post',
    params: parameter
  })
}
